package com.cn.lf.wx.dacs.bussiness.author.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.cn.lf.wx.dacs.bussiness.author.bean.ReturnEntity;
import com.cn.lf.wx.dacs.bussiness.author.entity.AuthMenu;
import com.cn.lf.wx.dacs.bussiness.author.serviceImpl.AuthMenuServiceImpl;

@RestController
public class AuthMenuApi {

	@Autowired
    private AuthMenuServiceImpl authMenuService;

    @PostMapping("/admin/menu/create")
    public ReturnEntity createMenu(@RequestBody AuthMenu menu) {
        return authMenuService.createMenu(menu);
    }

    @PostMapping("/admin/menu/modify")
    public ReturnEntity modifyMenu(@RequestBody AuthMenu menu) {
        return authMenuService.modifyMenu(menu);
    }

    @GetMapping("/admin/menu/list-all")
    public ReturnEntity menuListAll() {
        return authMenuService.menuListAll();
    }

    @PostMapping("/admin/menu/delete")
    public ReturnEntity deleteMenu(@RequestBody AuthMenu menu) {
        return authMenuService.deleteMenu(menu);
    }

    //    根据角色 查询 菜单 列表
    @GetMapping("/admin/auth/menus/role")
    public ReturnEntity menusForRole(String role) {
        return authMenuService.menusForRole(role);
    }
    
    
}
